<template>
  <el-card class="mt-2">
    <div slot="header" class="clearfix">
      <b-img :src="require('../assets/img/'+titleImg)" class="titleimg"></b-img>
      <h2 class="d-inline">{{titleName}}</h2>
      <el-button style="float: right; padding: 3px 0" type="text" @click="allAr">查看全部</el-button>
    </div>
    <article-list :data="data"></article-list>
  </el-card>

</template>

<script>
export default {
  name: 'articles',
  props: ['titleName', 'titleImg', 'data'],
  data () {
    return {
    }
  },
  methods: {
    allAr: function () {
      this.$router.push({
        name: 'allAr',
        params: {
          cid: this.data[0].cid,
          page: 1,
          orderBy: 'create_time'
        }
      }
      )
    }
  }
}
</script>

<style scoped>
</style>
